{"version":3,"file":"static/chunks/pages/category/[slug]-2ef764429ba6146c.js","mappings":"AACA","sources":["webpack://_N_E/?8fdc","webpack://_N_E/./src/lib/apiService/index.ts","webpack://_N_E/./src/lib/utils/newPlan.tsx","webpack://_N_E/./src/modules/products/views/ProductTypeListView.tsx","webpack://_N_E/./src/modules/products/pages/ProductTypeListPage.tsx","webpack://_N_E/./src/pages/category/[slug]/index.tsx","webpack://_N_E/"],"sourcesContent":["\n (window.__NEXT_P = window.__NEXT_P || []).push([\n \"/category/[slug]\",\n function () {\n return require(\"private-next-pages/category/[slug]/index.tsx\");\n }\n ]);\n if(module.hot) {\n module.hot.dispose(function () {\n window.__NEXT_P.push([\"/category/[slug]\"])\n });\n }\n ","export * from \"./ICommand\";\nexport * from \"./RestfulApiService\";\nexport const isAxiosError = (error)=>!!error.isAxiosError;\n","export const useNewPlanVar = process.env.NEXT_PUBLIC_FEATURES_2023_04_NEW_PLAN === \"true\";\nconst useNewPlanUI = ()=>{\n // const [useNewPlan, setUseNewPlan] = useState(false)\n // const router = useRouter()\n // useEffect(() => {\n // \tconst { query } = router\n // \tconst newPlan = query.useNewPlan\n //\n // \tif (newPlan === 'true') {\n // \t\tsetUseNewPlan(true)\n // \t}\n // }, [router.query])\n //\n const useNewPlan = process.env.NEXT_PUBLIC_FEATURES_2023_04_NEW_PLAN === \"true\";\n return {\n useNewPlan\n };\n};\nexport default useNewPlanUI;\nexport const useStudio = ()=>{\n // const [useStudio, setUseStudio] = useState(false)\n // const router = useRouter()\n //\n // useEffect(() => {\n // \tconst { query } = router\n // \tconst newPlanStudio = query.useStudio\n //\n // \tif (newPlanStudio === 'true') {\n // \t\tsetUseStudio(true)\n // \t}\n // }, [router.query])\n const useStudio = process.env.NEXT_PUBLIC_FEATURES_2023_04_STUDIO === \"true\";\n return {\n useStudio\n };\n};\nexport const usePurchaseCheck = ()=>{\n const usePurchaseCheck = process.env.NEXT_PUBLIC_FEATURES_2023_05_LICENSE_PURCHASE_CHECK === \"true\";\n return {\n usePurchaseCheck\n };\n};\nexport const useParsingBadge = ()=>{\n const useParsingBadge = process.env.NEXT_PUBLIC_FEATURES_2023_06_PARSING_BADGE === \"true\";\n return {\n useParsingBadge\n };\n};\nexport const useBuyStudio = ()=>{\n const useBuyStudio = process.env.NEXT_PUBLIC_FEATURES_2023_06_BUY_STUDIO === \"true\";\n return {\n useBuyStudio\n };\n};\nexport const ENV_NO_BASE_LICENSE_ID = ()=>{\n return {\n id: process.env.NEXT_PUBLIC_TEMP_SOURCE_ID\n };\n};\n","import { _ as _tagged_template_literal } from \"@swc/helpers/_/_tagged_template_literal\";\nfunction _templateObject() {\n const data = _tagged_template_literal([\n \"\\n display: flex;\\n justify-content: center;\\n margin-top: 24px;\\n\"\n ]);\n _templateObject = function() {\n return data;\n };\n return data;\n}\nimport { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport { ActiveLink } from \"@/components/ActiveLink\";\nimport { DefaultLoadingContainer } from \"@/components/DefaultLoadingContainer\";\nimport { GenericPanelWithModal } from \"@/components/GenericPanel\";\nimport { useStores } from \"@/hooks/useStores\";\nimport { useApiService } from \"@/lib/apiService\";\nimport useNewPlanUI, { useParsingBadge } from \"@/lib/utils/newPlan\";\nimport { includesPath } from \"@/lib/utils/url\";\nimport { useViewModel } from \"@/lib/viewModels\";\nimport useWindowDimensions from \"@/lib/web-ui/useWindowDimensions\";\nimport { CATEGORY_HANDOUT_PAGE, CATEGORY_TEXTBOOK_PAGE, CATEGORY_WORKBOOK_PAGE } from \"@/settings/constant\";\nimport { Col, Menu, Pagination, Row } from \"antd\";\nimport { runInAction } from \"mobx\";\nimport { observer } from \"mobx-react-lite\";\nimport { useRouter } from \"next/router\";\nimport React, { useEffect } from \"react\";\nimport styled from \"styled-components\";\nimport { ProductCurrentFilterTag } from \"../components/ProductCurrentFilterTag\";\nimport { ProductFilterBox } from \"../components/ProductFilterBox\";\nimport { ProductList } from \"../components/ProductList\";\nimport { ProductUnifiedSearchResultWrapper } from \"../components/ProductTypeSearchResult\";\nimport { ProductTypeSearchResultHeader } from \"../components/ProductTypeSearchResultHeader\";\nimport { SearchResultFilter } from \"../components/SearchResultFilter\";\nimport { SearchResultHeader } from \"../components/SearchResultHeader\";\nimport { ProductListViewModel } from \"../viewModels/ProductListViewModel\";\nimport { ProductListViewWrapper } from \"./ProductListView\";\nconst PaginationWrapper = styled.div.withConfig({\n componentId: \"sc-f14dd49e-0\"\n})(_templateObject());\nconst mobileMenuFilters = [\n {\n label: \"수업자료\",\n value: \"1\",\n path: CATEGORY_HANDOUT_PAGE\n },\n {\n label: \"교과서\",\n value: \"2\",\n path: CATEGORY_TEXTBOOK_PAGE\n },\n {\n label: \"참고서\",\n value: \"3\",\n path: CATEGORY_WORKBOOK_PAGE\n }\n];\nexport const ProductTypeListView = observer((param)=>{\n let { products } = param;\n const productStore = useStores();\n const router = useRouter();\n const apiService = useApiService();\n const { asPath } = router;\n const { width } = useWindowDimensions();\n const { useNewPlan } = useNewPlanUI();\n const { useParsingBadge: useParsingBadgeValue } = useParsingBadge();\n // const useNewPlan = true\n const { status , actions } = useViewModel({\n rootStore: productStore,\n router,\n apiService,\n products,\n useNewPlan\n }, ProductListViewModel);\n useEffect(()=>{\n runInAction(()=>{\n status.useNewPlan = useNewPlan;\n });\n }, [\n useNewPlan\n ]);\n useEffect(()=>{\n runInAction(()=>{\n status.useParsingBadge = useParsingBadgeValue;\n });\n }, [\n useParsingBadge\n ]);\n const currentPagination = actions.getPagination();\n return /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n !status.initialized && /*#__PURE__*/ _jsx(DefaultLoadingContainer, {\n title: \"데이터를 불러오는 중입니다.\"\n }),\n status.initialized && /*#__PURE__*/ _jsxs(ProductListViewWrapper, {\n children: [\n /*#__PURE__*/ _jsx(SearchResultHeader, {\n keyword: actions.keyword,\n total: actions.getPagination().total,\n onCart: actions.onCart,\n goToCart: actions.goToCart,\n isModalOpen: status.isModalOpen\n }),\n /*#__PURE__*/ _jsxs(Row, {\n gutter: 72,\n children: [\n /*#__PURE__*/ _jsx(Col, {\n span: 6,\n className: status.showFilter ? \"filter-box show\" : \"filter-box\",\n children: /*#__PURE__*/ _jsx(SearchResultFilter, {\n dataSource: actions.currentFilters,\n onShowModal: actions.onShowModal,\n onShowMobileFilter: actions.onShowMobileFilter,\n onReset: actions.onResetFilter,\n selectedItems: actions.currentSelectedFilters,\n onChangeFilterItems: actions.onChangeFilterItems,\n deleteItem: status.deleteFilterItem,\n resetFilter: status.resetFilter\n })\n }),\n /*#__PURE__*/ _jsx(Col, {\n span: 18,\n className: \"result-box\",\n children: /*#__PURE__*/ _jsxs(ProductUnifiedSearchResultWrapper, {\n className: \"search-result-wrapper\",\n children: [\n /*#__PURE__*/ _jsx(Menu, {\n mode: \"horizontal\",\n children: mobileMenuFilters && mobileMenuFilters.map((item, idx)=>/*#__PURE__*/ _jsx(Menu.Item, {\n children: /*#__PURE__*/ _jsx(ActiveLink, {\n className: includesPath(asPath, item.path) ? \"active-link active\" : \"active-link\",\n href: \"\".concat(item.path),\n children: item.label\n })\n }, \"mobile_filter_\".concat(idx)))\n }),\n /*#__PURE__*/ _jsxs(\"div\", {\n className: \"section\",\n children: [\n /*#__PURE__*/ _jsx(ProductCurrentFilterTag, {\n onFilterClick: actions.onShowMobileFilter,\n filterItems: actions.currentSelectedFilters,\n deleteFilterItem: actions.deleteFilterItem\n }),\n /*#__PURE__*/ _jsx(ProductTypeSearchResultHeader, {\n sorting: actions.onSorting,\n parsing: actions.onParsing,\n parsingState: status.parsing,\n onEmptyClick: actions.onEmptyClick,\n onItemClick: actions.onItemClick,\n onSelectAll: actions.onSelectAll,\n sortStatus: status.sort,\n totalCount: currentPagination.total,\n category: actions.category,\n useParsingBadge: status.useParsingBadge\n }),\n status.loading ? /*#__PURE__*/ _jsx(DefaultLoadingContainer, {\n title: \"데이터를 불러오는 중입니다.\"\n }) : /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n /*#__PURE__*/ _jsx(ProductList, {\n useNewPlan: status.useNewPlan,\n useParsingBadge: status.useParsingBadge,\n onPriceChange: actions.onPriceChange,\n onClick: actions.onItemClick,\n dataSource: actions.items,\n onEmptyClick: actions.onEmptyClick,\n allChecked: status.allChecked,\n selectedItems: actions.selectedItems,\n onChangeSelectedItems: actions.onChangeSelectedItems\n }),\n /*#__PURE__*/ _jsx(PaginationWrapper, {\n children: /*#__PURE__*/ _jsx(Pagination, {\n ...currentPagination.current,\n onChange: actions.updatePageChange\n })\n })\n ]\n })\n ]\n })\n ]\n })\n })\n ]\n }),\n /*#__PURE__*/ _jsx(GenericPanelWithModal, {\n title: \"단원/UNIT\",\n closeIcon: true,\n okText: \"확인\",\n open: status.showModal,\n cancelText: \"초기화\",\n onClose: ()=>actions.onShowModal(null, null),\n onOk: ()=>actions.onShowModal(null, null),\n children: /*#__PURE__*/ _jsx(ProductFilterBox, {\n idx: status.currentModalIdx,\n filterItems: actions.currentSelectedFilters,\n currentSelectedInBox: status.currentSelectedInBox,\n updateFilterItem: actions.onChangeFilterItems,\n deleteItem: status.deleteFilterItem\n })\n })\n ]\n })\n ]\n });\n});\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from \"react\";\nimport { Provider } from \"mobx-react\";\nimport { createProductStore } from \"../stores/ProductModel\";\nimport { ProductTypeListView } from \"../views/ProductTypeListView\";\nexport const ProductTypeListPage = (param)=>{\n let { products } = param;\n const store = createProductStore({\n products\n });\n return /*#__PURE__*/ _jsx(\"div\", {\n children: /*#__PURE__*/ _jsx(Provider, {\n ...store,\n children: /*#__PURE__*/ _jsx(ProductTypeListView, {})\n })\n });\n};\n","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport React from \"react\";\nimport { Container } from \"@/components\";\nimport { ProductTypeListPage } from \"@/modules/products/pages/ProductTypeListPage\";\nimport { ProductIndexPageWrapper } from \"@/modules/products/components/ProductList\";\nconst ProductCategoryNextPage = (param)=>{\n let { products } = param;\n return /*#__PURE__*/ _jsx(ProductIndexPageWrapper, {\n children: /*#__PURE__*/ _jsx(Container, {\n children: /*#__PURE__*/ _jsx(ProductTypeListPage, {\n products: products\n })\n })\n });\n};\nexport var __N_SSP = true;\nexport default ProductCategoryNextPage;\n"],"names":[],"sourceRoot":""}